// 设计稿宽度
$vm_design: 750;
// 为什么设置 100? 设置成便于计算, 计算rem时只需要将 设计稿的宽度 / 100 即可
// 如果给的是 375 的标注图, 也只需要将标注尺寸 * 2 / 100 即可
$vm_fontsize: 100;
html {
    --body-width: 7.5rem;
    --tabbar-height: 100px;
    font-size: $vm_fontsize / $vm_design * 100vw;
    // 同时，通过Media Queries 限制根元素最大最小值
    @media screen and (max-width: 320PX) {
        font-size: 320PX / $vm_design * $vm_fontsize;
    }
    @media screen and (min-width: 540PX) {
        --body-width: 540PX;
        font-size: 540PX / $vm_design * $vm_fontsize;
    }
}
// body 也增加最大最小宽度限制，避免默认100%宽度的 block 元素跟随 body 而过大过小
body {
    max-width: 540PX;
    min-width: 320PX;
    min-height: 100vh;
    margin: 0 auto !important;
    background: #f4f4f4;
    color: #000;
    font-size: 0.24rem;
    line-height: 1;
}

.fixed-center {
    width: 100%;
    max-width: 540PX;
    min-width: 320PX;
    left: calc((100% - var(--body-width)) / 2) !important;
}

.body {
    position: absolute;
    width: 100%;
    max-width: 540PX;
    min-width: 320PX;
    // height: 100vh;
    // padding-bottom: var(--tabbar-height);
    height: 100vh;
    box-sizing: border-box;
    background: #f8f8f8;
    transition: all 0.4s;
    overflow-y: scroll;
    -webkit-overflow-scrolling : touch;
    &.is-tab {
        height: calc(100vh - var(--tabbar-height));
    }
}

.wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.global-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background: rgba(255,255,255,0.1);
}
.router-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(255,255,255,0.1);
}

.load-more {
    margin: 20px 0;
}

/* 通用样式 */

.margin-top-20px {
    margin-top: 20px;
}


.slide-left-enter,
.slide-right-leave-active {
    opacity: 0;
    transform: translate(100%, 0);
}
.slide-left-leave-active,
.slide-right-enter {
    opacity: 0;
    transform: translate(-100%, 0);
}
/* .fade-leave-active below version 2.1.8 */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to {
    opacity: 0;
}

/* start--文本行数限制--start */
.u-line-1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.u-line-2 {
    -webkit-line-clamp: 2;
}

.u-line-3 {
    -webkit-line-clamp: 3;
}

.u-line-4 {
    -webkit-line-clamp: 4;
}

.u-line-5 {
    -webkit-line-clamp: 5;
}

.u-line-2, .u-line-3, .u-line-4, .u-line-5 {
    overflow: hidden;
	word-break: break-all;
    text-overflow: ellipsis;
    display: -webkit-box; // 弹性伸缩盒
    -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
}

/* end--文本行数限制--end */


/* start--Retina 屏幕下的 1px 边框--start */
.u-border,
.u-border-bottom,
.u-border-left,
.u-border-right,
.u-border-top,
.u-border-top-bottom {
	position: relative
}

.u-border-bottom:after,
.u-border-left:after,
.u-border-right:after,
.u-border-top-bottom:after,
.u-border-top:after,
.u-border:after {
	content: ' ';
	position: absolute;
	left: 0;
	top: 0;
	pointer-events: none;
	box-sizing: border-box;
	transform-origin: 0 0;
	// 多加0.1%，能解决有时候边框缺失的问题
	width: 199.8%;
	height: 199.7%;
	transform: scale(0.5, 0.5);
	border: 0 solid #e4e7ed;;
	z-index: 2;
}

.u-border-top:after {
	border-top-width: 1PX;
}

.u-border-left:after {
	border-left-width: 1PX;
}

.u-border-right:after {
	border-right-width: 1PX;
}

.u-border-bottom:after {
	border-bottom-width: 1PX;
}

.u-border-top-bottom:after {
	border-width: 1PX 0;
}

.u-border:after {
	border-width: 1PX;
}
/* end--Retina 屏幕下的 1px 边框--end */
